package model

import (
	"context"
	"service/ctrl"
	"service/model/mod"

	comm "gitee.com/cloudapex/protos/comm/pb"
	gpb "gitee.com/cloudapex/protos/crm_base/pb"
	"google.golang.org/grpc"
)

var Base base

func init() {
	ctrl.GCon.RegistClienter(mod.GCONN_CRM_BASE, func(c *grpc.ClientConn) {
		Base.cli = gpb.NewBasePoolSerClient(c)
	})
}

type base struct {
	cli gpb.BasePoolSerClient
}

//获取首咨库存工作池列表
func (this *base) GetPoolList(ctx context.Context, in *gpb.BasePoolReq) (*gpb.BasePoolRes, error) {
	return this.cli.GetPoolList(ctx, in)
}
func (this *base) AddPool(ctx context.Context, in *gpb.BasePoolReq) (*gpb.AddPoolRes, error) {
	return this.cli.AddPool(ctx, in)
}
func (this *base) SelectPool(ctx context.Context, in *gpb.BasePoolReq) (*gpb.PoolRes, error) {
	return this.cli.SelectPool(ctx, in)
}
func (this *base) GetPool(ctx context.Context, in *gpb.PoolReq) (*gpb.PoolRes, error) {
	return this.cli.GetPool(ctx, in)
}
func (this *base) SetPoolLogic(ctx context.Context, in *gpb.PoolLogicReq) (*comm.BaseRes, error) {
	return this.cli.SetPoolLogic(ctx, in)
}
func (this *base) EditPool(ctx context.Context, in *gpb.BasePoolReq) (*comm.BaseRes, error) {
	return this.cli.EditPool(ctx, in)
}

func (this *base) BackPool(ctx context.Context, in *gpb.BaseProject) (*comm.BaseRes, error) {
	return this.cli.BackPool(ctx, in)
}

//索取首资
func (this *base) GetFirstConsu(ctx context.Context, in *gpb.FirstConsuReq) (*gpb.PoolRes, error) {
	return this.cli.GetFirstConsu(ctx, in)
}

//签到接口，签到后参数自动分首咨
func (this *base) SignFirstConsu(ctx context.Context, in *gpb.SignFirstConsuReq) (*comm.BaseRes, error) {
	return this.cli.SignFirstConsu(ctx, in)
}
